:root {
  --tk-color-text: #27272a;
  --tk-background: rgba(238, 238, 238, 0.87);
  --tk-background-button: rgba(255, 255, 255, 0.96);
  --tk-background-button-fn: rgba(255, 255, 255, 0.5);
  --tk-background-button-active: rgba(0, 0, 0, 0.04);
}

.dark {
  --tk-color-text: #ffffff;
  --tk-background: rgba(33, 33, 33, 0.87);
  --tk-background-button: rgba(66, 66, 66, 0.96);
  --tk-background-button-fn: rgba(66, 66, 66, 0.5);
  --tk-background-button-active: rgba(255, 255, 255, 0.2);
}

ngx-touch-keyboard {
  z-index: 999999;
  width: 100%;
  padding: 0.25rem;
  padding-bottom: 0.375rem;
  border-radius: 0.375rem;
  touch-action: manipulation;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  display: flex;
  justify-content: center;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  background: var(--tk-background);
  box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.2),
    0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12);
}

.touch-keyboard {
  z-index: 999999;
  flex: 1 1 auto;
  max-width: 840px;

  .touch-keyboard-row {
    display: flex;
    flex-direction: row;

    &:not(:last-child) {
      margin-bottom: 0.25rem;
    }
  }

  .touch-keyboard-key {
    z-index: 999999;
    width: 20px;
    box-sizing: border-box;
    position: relative;
    -webkit-user-select: none;
    user-select: none;
    cursor: pointer;
    outline: none;
    border: none;
    text-align: center;
    margin: 0;
    line-height: 32px;
    padding: 0.25rem;
    border-radius: 0.375rem;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    flex-grow: 1;
    align-items: center;
    justify-content: center;
    color: var(--tk-color-text);
    background-color: var(--tk-background-button);
    box-shadow: 0px 3px 1px -2px rgba(0, 0, 0, 0.20),
      0px 2px 2px 0px rgba(0, 0, 0, 0.14), 0px 1px 5px 0px rgba(0, 0, 0, 0.12);

    > svg {
      fill: var(--tk-color-text);
    }

    &.function-key:not(.space-key) {
      background-color: var(--tk-background-button-fn);
    }

    &.active {
      background-color: var(--tk-background-button-active) !important;
    }

    &.alphabetic-key,
    &.numeric-key,
    &.symbolic-key,
    &.language-key,
    &.done-key {
      max-width: 4rem;
    }

    &.space-key {
      min-width: 40%;
    }

    &[data-layout="numeric"],
    &[data-layout="decimal"],
    &[data-layout="tel"] {
      width: 33%;
      max-width: none;
    }

    &:not(:last-child) {
      margin-right: 0.25rem;
    }
  }
}

@media (min-width: 600px) {
  .touch-keyboard {
    .touch-keyboard-key {
      &.alphabetic-key,
      &.numeric-key,
      &.symbolic-key,
      &.done-key {
        max-width: 6rem;
      }
    }
  }
}
